"use strict";

module.exports = {
  up: async (queryInterface, Sequelize) => {
    /**
     * Add altering commands here.
     *
     * Example:
     * await queryInterface.createTable('users', { id: Sequelize.INTEGER });
     */
    const { INTEGER, FLOAT, DATE, STRING } = Sequelize;
    await queryInterface.createTable("fund_default_rankings", {
      id: { type: INTEGER, primaryKey: true, autoIncrement: true },
      fund_code: STRING(7),
      fund_name: STRING(36),
      networth: FLOAT, // 净值
      networth_total: FLOAT, // 累计全部净值
      day_growth: FLOAT, // 日涨幅
      last_growth_7: FLOAT, // 7天涨幅
      last_growth_30: FLOAT,
      last_growth_60: FLOAT,
      last_growth_90: FLOAT,
      last_growth_360: FLOAT,
      last_growth_720: FLOAT,
      last_growth_1080: FLOAT,
      last_growth_year: FLOAT, // 近年来
      last_growth_all: FLOAT, // 成立以来
      creatTimeLimit: STRING(10), // 成立时间
      add_time: STRING(10),
      created_at: DATE,
      updated_at: DATE,
      deleted_at: DATE,
    });
  },

  down: async (queryInterface, Sequelize) => {
    /**
     * Add reverting commands here.
     *
     * Example:
     * await queryInterface.dropTable('users');
     */
    await queryInterface.dropTable("fund_default_rankings");
  },
};
